import { http } from "@/utils/http"

/**
 * 收获地址列表
 */
export const getAddressList = (data) => {
    return http({
        method: 'POST',
        url: '/order/selectUserAddrList',
        data,
    })
}

/**
 * 新增用户收货地址
 */
export const addOrUpdateAddress = (data) => {
    return http({
        method: 'POST',
        url: '/order/addOrUpdateUserAddr',
        data,
    })
}

/**
 * 删除用户地址
 */
export const deleteAddress = (data) => {
    return http({
        method: 'POST',
        url:  '/order/deleteUserAddr',
        data,
    })
}

/**
 * 收获地址详情
 */
export const getAddressInfo = (id) => {
    return http({
        method: 'GET',
        url:  `/client/address/${id}`,
    })
}

/**
 * 解析地址
 */
export const matchAddressInfo = (data) => {
    return http({
        method: 'POST',
        url:  '/order/match',
        data,
    })
}